///
/// # Generics
///
/// Generics is the topic of generalizing types and functionalities to broader cases.
/// ```
/// fn foo<T>(arg: T) { ... }
/// ```
///
/// ## Functions
///
/// ## Implementation
///
/// ## Traits
///
/// ## Bounds
///
/// ## Multiple bounds
///
/// ## Where clauses
///
/// ## New Type Idiom
///
/// ## Associated items
///
/// ## Phantom type parameters
///

struct Val {
    val: f64,
}

struct GenVal<T> {
    gen_val: T,
}

impl Val {
    fn value(&self) -> &f64 {
        &self.val
    }
}

impl<T> GenVal<T> {
    fn value(&self) -> &T {
        &self.gen_val
    }
}

#[test]
fn test_generics() {
    let x = Val { val: 3.0 };
    let y = GenVal { gen_val: 3i32 };
    println!("{}, {}", x.value(), y.value());
}
